package cn.com.shopec.erp.purchase.entity;

import java.io.Serializable;
import java.util.List;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import org.hibernate.annotations.GenericGenerator;

/** 
 * @ClassName: PurchaseOrder 
 * @Description: 采购单表的实体
 * @author: lule
 * @date 2013-5-22 上午9:51:50
 *  
 */
@Entity
@Table(name="TBL_PURCHASE_ORDER")
public class PurchaseOrder implements Serializable {
	private static final long serialVersionUID = 1346239169105302846L;
	
	/** id **/
	private String id;
	/** 采购单号 **/
	private String poNo;
	/** 预计采购日期 **/
	private String foPurDate;
	/** 采购员用户 **/
	private String createPerson;
	/** 删除标识 **/
	private int deleteFlag;
	/** 实际采购日期 **/
	private String acPurDate;
	/** 采购单状态 （0待审核1.已审核2.采购中,3.入库中,4.部分入庫,5.采购完成）**/
	private int poStatus;
	/**采购类型**/
	private int purcType;
	/**采购单名称**/
	private String poName;
	/** 到货日期 **/
	private String prArriveDate;
	/** 创建时间 **/
	private String createTime;
	/** 修改时间 **/
	private String prCreaterDate;
	/** 最近审核人 **/
	private String lastAuditPerson;
	/** 最近审核时间 **/
	private String lastAuditTime;
	/** PO关联的货品实体 **/
	private List<PoProduct> poProducts; 
	/** 当前审核点 (1：待采购主管处理、2：待采购总监及运营主管处理、3：待财务负责人处理、4：待总经理处理、99：已完成) **/
	private Integer curAuditPoint;
	/** 审核人身份。采购主管(PURCHASE_SUPERVISOR)、采购总监(PURCHASE_DIRECTOR)、运营主管(OPERATION_SUPERVISOR)、财务负责人(FINANCIAL_PRINCIPAL)、总经理(GENERAL_MANAGER) **/
	private String lastAuditRole;
	/** 审核状态( 0审核不通过，1审核通过)**/
	private int auditResult;
	/** 审核意见**/
	private String remark;
	/**审核时间**/
	private String auditTime;
	/**供应商编号**/
	private String supCode;
	/**供应商名称**/
	private String supName;
	/**订单结算时间 （请购单中的到货时间）**/
	private String overData;
	/**退货数量**/
	private int returnQuantity;
	/**描述**/
	private String prDescribe;
	/**成本价**/
	private String ppUnitPrice;
	/**数量**/
	private int ppNumber;
	/**总价**/
	private Double totalPrice;
	/**供应商结算状态**/
	private Integer isSettled;

	@GenericGenerator(name = "generator", strategy = "uuid.hex")
	@Id
	@GeneratedValue(generator = "generator")
	@Column(name = "id", unique = true, nullable = false, length = 32)
	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}
	
	@Column(name = "po_no")
	public String getPoNo() {
		return poNo;
	}
	
	public void setPoNo(String poNo) {
		this.poNo = poNo;
	}
	
	@Column(name = "fo_pur_date")
	public String getFoPurDate() {
		return foPurDate;
	}
	
	public void setFoPurDate(String foPurDate) {
		this.foPurDate = foPurDate;
	}
	
	@Column(name = "ac_pur_date")
	public String getAcPurDate() {
		return acPurDate;
	}
	
	public void setAcPurDate(String acPurDate) {
		this.acPurDate = acPurDate;
	}
	
	@Column(name = "po_status")
	public int getPoStatus() {
		return poStatus;
	}
	
	public void setPoStatus(int poStatus) {
		this.poStatus = poStatus;
	}
	
	@Column(name = "cur_audit_point")
	public Integer getCurAuditPoint() {
		return curAuditPoint;
	}

	public void setCurAuditPoint(Integer curAuditPoint) {
		this.curAuditPoint = curAuditPoint;
	}

	@Column(name = "last_audit_role")
	public String getLastAuditRole() {
		return lastAuditRole;
	}

	public void setLastAuditRole(String lastAuditRole) {
		this.lastAuditRole = lastAuditRole;
	}

	@Column(name = "create_time")
	public String getCreateTime() {
		return createTime;
	}
	
	public void setCreateTime(String createTime) {
		this.createTime = createTime;
	}
	
	@Column(name = "delete_flag")
	public int getDeleteFlag() {
		return deleteFlag;
	}
	
	public void setDeleteFlag(int deleteFlag) {
		this.deleteFlag = deleteFlag;
	}
	
	@Column(name = "create_person")
	public String getCreatePerson() {
		return createPerson;
	}

	public void setCreatePerson(String createPerson) {
		this.createPerson = createPerson;
	}
	@Column(name="PURCHASE_TYPE")
	public int getPurcType() {
		return purcType;
	}

	public void setPurcType(int purcType) {
		this.purcType = purcType;
	}
	@Column(name="OVER_DATA")
	public String getOverData() {
		return overData;
	}

	public void setOverData(String overData) {
		this.overData = overData;
	}
    @Column(name="PR_DESCRIBE")
	public String getPrDescribe() {
		return prDescribe;
	}

	public void setPrDescribe(String prDescribe) {
		this.prDescribe = prDescribe;
	}

	public String getPoName() {
		return poName;
	}

	public void setPoName(String poName) {
		this.poName = poName;
	}

	public String getPrCreaterDate() {
		return prCreaterDate;
	}

	public void setPrCreaterDate(String prCreaterDate) {
		this.prCreaterDate = prCreaterDate;
	}

	public String getPrArriveDate() {
		return prArriveDate;
	}

	public void setPrArriveDate(String prArriveDate) {
		this.prArriveDate = prArriveDate;
	}

	public String getLastAuditPerson() {
		return lastAuditPerson;
	}

	public void setLastAuditPerson(String lastAuditPerson) {
		this.lastAuditPerson = lastAuditPerson;
	}

	public String getLastAuditTime() {
		return lastAuditTime;
	}

	public void setLastAuditTime(String lastAuditTime) {
		this.lastAuditTime = lastAuditTime;
	}

	@OneToMany(fetch = FetchType.LAZY)
	@JoinColumn(name = "po_no", referencedColumnName = "po_no", insertable = false, updatable = false)
	public List<PoProduct> getPoProducts() {
		return this.poProducts;
	}

	public void setPoProducts(List<PoProduct> poProducts) {
		this.poProducts = poProducts;
	}

	public int getAuditResult() {
		return auditResult;
	}

	public void setAuditResult(int auditResult) {
		this.auditResult = auditResult;
	}

	public String getRemark() {
		return remark;
	}

	public void setRemark(String remark) {
		this.remark = remark;
	}

	public String getAuditTime() {
		return auditTime;
	}

	public void setAuditTime(String auditTime) {
		this.auditTime = auditTime;
	}

	public String getSupCode() {
		return supCode;
	}
	
	public void setSupCode(String supCode) {
		this.supCode = supCode;
	}

	public String getSupName() {
		return supName;
	}

	public void setSupName(String supName) {
		this.supName = supName;
	}

	public int getReturnQuantity() {
		return returnQuantity;
	}

	public void setReturnQuantity(int returnQuantity) {
		this.returnQuantity = returnQuantity;
	}

	public String getPpUnitPrice() {
		return ppUnitPrice;
	}

	public void setPpUnitPrice(String ppUnitPrice) {
		this.ppUnitPrice = ppUnitPrice;
	}

	public int getPpNumber() {
		return ppNumber;
	}

	public void setPpNumber(int ppNumber) {
		this.ppNumber = ppNumber;
	}

	public Double getTotalPrice() {
		return totalPrice;
	}

	public void setTotalPrice(Double totalPrice) {
		this.totalPrice = totalPrice;
	}

	@Column(name="is_settled")
	public Integer getIsSettled() {
		return isSettled;
	}

	public void setIsSettled(Integer isSettled) {
		this.isSettled = isSettled;
	}
	
}